<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="js/vue-2.5.16.js"></script>
</head>
<body>
    <div id="app">
        {{name}}
        <button @click=dianji>点击</button>
        <a :href='url'>百度</a> 
        <zuojian_all></zuojian_all>       
    </div>
    <script>
        var zujian_a ={
            template:'<div>局部组件{{pos}}</div> ',
            //接收全局数据
            props:['pos']
        }
        Vue.component(
            'zuojian_all',
            {   
                template:'<div>全局组件<zujian_a></zujian_a v-bind:pos="age">{{age}}</div>',
                //将局部组件绑定到全局
                // 组件绑定数据
                data:function(){
                    return {
                        age:18
                    }
                },
                components:{
                    zujian_a
                }
                

            }
        )
        new Vue({
            el:"#app",
            data: {
              name:"python",
              url:'http://www.baidu.com'
            },
            methods: {
                 dianji: function(){
                    alert(11111111)
                }
            }
        })
    </script>
</body>
</html>